package com.qf.springcloud.aircore.fallback;

import com.qf.springcloud.aircore.client.SearchClient;
import feign.hystrix.FallbackFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class SearchFallbackFactory implements FallbackFactory<SearchClient> {

    @Autowired
    private SearchClientImpl searchClient;

    @Override
    public SearchClient create(Throwable cause) {
        cause.printStackTrace();
        return searchClient;
    }
}
